package com.zctest.service.impl;

import com.zctest.dao.CompanyRepository;
import com.zctest.entity.Company;
import com.zctest.service.CompanyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zhangchao
 * @version 1.0
 * @date 2019/1/7
 */
@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    private CompanyRepository companyRepository;


    @Transactional
    @Override
    public void save(Company company) {
        Logger logger = LoggerFactory.getLogger(CompanyServiceImpl.class);
        logger.info("进入公司保存");
        companyRepository.save(company);
        logger.info("公司保存成功");
    }
}
